package model;

import javassist.Modifier;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This class is the representation of an attribute (field) in a Java object.
 * @author Corentin
 *
 */
public class Attribute {
	private static final Logger logger = LoggerFactory
			.getLogger(Attribute.class);

	private String name;
	private String clazz;
	private int modifier;

	/**
	 * Default constructor.
	 */
	public Attribute() {
		this.name = null;
		this.clazz = null;
	}

	
	/** Constructor for the Attribute class
	 * @param name - name of the attribute
	 * @param clazz - type of the attribute
	 * @param modifier - modifier of the attribute (public, static, private, final, ...)
	 */
	public Attribute(String name, String clazz, int modifier) {
		this.name = name;
		this.clazz = clazz;
		this.modifier = modifier;
	}

	@Override
	public String toString() {
		return Modifier.toString(this.modifier) + " " 
				+this.clazz+ " "
				+this.name;
		
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public int getModifier() {
		return modifier;
	}

	public void setModifier(int modifier) {
		this.modifier = modifier;
	}
}
